package cn.xzqwjw.taskmanager.controller.api;

import cn.xzqwjw.taskmanager.domain.vo.ResponseVo;
import cn.xzqwjw.taskmanager.service.IndexService;
import cn.xzqwjw.taskmanager.utils.JsonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author rush
 */
@RestController
@RequestMapping("/api")
public class IndexApiController {

  private final IndexService indexService;

  @Autowired
  public IndexApiController(IndexService indexService) {
    this.indexService = indexService;
  }

  @GetMapping("")
  public String index() {
    return JsonUtil.obj2Json(ResponseVo.success());
  }

  @GetMapping("/")
  public String root() {
    return JsonUtil.obj2Json(ResponseVo.success());
  }

}
